// $Id: storedfile.h 54 2004-10-11 15:31:22Z jonas $
#ifndef STOREDFILE_H
#define STOREDFILE_H

#include "clock.h"
class File;
class Node;

/**
 * Nodes will want to store files localy. This class (as opposed to the File
 * class) has lots of nice features like a timestep for when the file was last
 * used, how much data of the acctual file we have (simce it might not be
 * fully downloaded yet and ofcource what file "it is" (a pointer to a unique
 * File object).
 */
class StoredFile {
public:
	StoredFile(File *file) : m_file(file), m_size(0) { touch(); }
	StoredFile(File *file, int size) : m_file(file), m_size(size) { touch(); }

	void touch() {
		m_timeLastUsed = Clock::getInstance()->getTime();
	}

	const File *m_file;
	unsigned int m_size;
	unsigned int m_timeLastUsed;
};

#endif
